//
//  ST_AICenterPeculiaritySingleDetailCell.swift
//  btvideo
//
//  Created by mac on 2020/1/10.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SnapKit
import SwifterSwift
//一张图
class ST_AICenterPeculiaritySingleDetailCell: ST_AICenterPeculiarityDetailCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        
        images_container_view.addSubview(cover_image_view)
        cover_image_view.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate lazy var cover_image_view:ST_PairsCenterPeculiarityImageView = {
        let control = ST_PairsCenterPeculiarityImageView()
        control.contentMode = UIView.ContentMode.scaleAspectFill
        return control
    }()
    
    
    override func bind_model_view() {
        super.bind_model_view()
        
        
        if let item = self.model.detail.first, let url = item.content.compress_image().url{
            
            cover_image_view.pin_setImage(from: url, placeholderImage: ST_SwiftConst.shared.fetch_random_place_holder_image())
            
            cover_image_view.isCheck = item.state == 1
        }
        
        
        
//        #if DEBUG
//        cover_image_view.backgroundColor = Color.random
//        #endif
    }
    
}
